//------奖金项相关----------

import request from "@/router/axios";

//获取负责机构
export function getOrg(){
  return request({
      url: '/admin/dept/getJiangJinBm',
      method: 'get'
    })
}

//获取负责机构二级
export function getPid(pid) {
  return request({
    url: '/admin/dept/getPid/' + pid,
    method: 'get'
  })
}

//获取奖金项编号
export function getSubEccCode(itemId) {
  return request({
    url: '/bonus/bonusitem/getSubEccCode/'+itemId,
    method: 'get',

  })
}


//奖金项新增
export function addObj(obj) {
  return request({
    url: '/bonus/bonusitem',
    method: 'post',
    data: obj
  })
}

//奖金项编辑
export function putObj(obj) {
  return request({
    url: '/bonus/bonusitem',
    method: 'put',
    data: obj
  })
}

//奖金项删除
export function deleteBatch(query) {
  return request({
    url: '/bonus/bonusitem/deleteBatch',
    method: 'get',
    params: query
  })
}


//奖金项查询
export function fetchList(query) {
  return request({
    url: '/bonus/bonusitem/page',
    method: 'get',
    params: query
  })
}

//系统内奖金项编号
export function getItemCode() {
  return request({
    url: '/bonus/bonusitem/getItemCode',
    method: 'get',
  })
}

//获取系统内子奖金项编号
export function getSubItemCode(itemId) {
  return request({
    url: '/bonus/bonusitem/getSubItemCode/'+itemId,
    method: 'get',
  })
}

//奖金项拆解 - 列表
export function getChildren(id,deptId) {
  return request({
    url: '/bonus/bonusitem/parentId/' + id + '/'+deptId,
    method: 'get'
  })
}

//奖金项范围
export function getBonusItemScope(type) {
  return request({
    url: '/admin/dict/type/bonusScope',
    method: 'get'
  })
}

